# models/operation_log.py
from abc import ABC, abstractmethod


class OperationLog(ABC):
    def __init__(self, user, page, product, payment):
        self.user = user
        self.page = page
        self.product = product
        self.payment = payment

    @abstractmethod
    def get_cost_description(self):
        pass

    def print_log(self):
        desc = self.get_cost_description()
        # 使用 page.display_name 获取“点餐页面”、“商城页面”、“积分页面”等枚举文案
        print(f"{self.user}在{self.page.display_name}使用{self.payment.method}{desc}")
